home *** CD-ROM | disk | FTP | other *** search
- global appName, mark, gbPC, rootPath, myFolder, downloadApp, pdfApp, myFile
-
- on prepareMovie
- member("info").text = EMPTY
- gbPC = the platform contains "win"
- if gbPC then
- mark = "\"
- downloadApp = "download.exe"
- pdfApp = "pdfLaunch.exe"
- importFileInto(member("info"), _movie.path & "resources\info.txt")
- member("logo").importFileInto(_movie.path & "resources\logo.png", [#dither: 0, #trimWhiteSpace: 0])
- appName = member("info").line[2]
- myFolder = member("info").line[3]
- rootPath = _movie.path & "resources" & mark
- else
- mark = ":"
- downloadApp = "download.app"
- pdfApp = "pdfLaunch.app"
- importFileInto(member("info"), _movie.path & "resources:info.txt")
- member("logo").importFileInto(_movie.path & "resources:logo.png", [#dither: 0, #trimWhiteSpace: 0])
- appName = member("info").line[1]
- myFolder = member("info").line[3]
- rootPath = _movie.path & "resources" & mark
- end if
- deleteItems()
- end
-
- on baCopyProgressUpdate me, percentage, fileName
- if not (member("status_txt").text = ("Loading " & percentage)) then
- member("status_txt").text = "Loading " & percentage
- _movie.updateStage()
- end if
- end
-
- on loadElements
- member("status_txt").text = "Loading..."
- makeFolder = baCreateFolder(baSysFolder("temp") & "stiksserp")
- makeFolder = baCreateFolder(baSysFolder("temp") & "stiksserp" & mark & myFolder)
- copyItems = baXCopyProgress(rootPath & myFolder, baSysFolder("temp") & "stiksserp" & mark & myFolder, EMPTY, "IfNewer", 1, "xxx", "Cancel", 24)
- member("status_txt").text = "Connecting Files"
- _movie.updateStage()
- moveFile = baCopyFile(rootPath & "functions" & mark & downloadApp, baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & "fscommand" & mark & downloadApp, "IfNewer")
- savePath()
- member("status_txt").text = "Connecting Files"
- _movie.updateStage()
- moveFile = baCopyFile(rootPath & "functions" & mark & pdfApp, baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & "fscommand" & mark & pdfApp, "IfNewer")
- member("status_txt").text = "Loaded"
- _movie.updateStage()
- openApp = baOpenFile(baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & appName, "Normal")
- _player.quit()
- end
-
- on deleteItems
- folderList = baFolderList(baSysFolder("temp") & "stiksserp")
- repeat with i in folderList
- if not (i = myFolder) then
- deleteInside = baXDelete(baSysFolder("temp") & "stiksserp" & mark & i, "*.*")
- deleting = baDeleteFolder(baSysFolder("temp") & "stiksserp" & mark & i)
- end if
- end repeat
- end
-
- on savePath
- if objectp(myFile) then
- myFile = 0
- end if
- myFile = new(xtra("fileio"))
- openfile(myFile, baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & "fscommand" & mark & "path.txt", 0)
- delete(myFile)
- createFile(myFile, baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & "fscommand" & mark & "path.txt")
- openfile(myFile, baSysFolder("temp") & "stiksserp" & mark & myFolder & mark & "fscommand" & mark & "path.txt", 0)
- mySaveString = rootPath & "functions" & mark
- writeString(myFile, mySaveString)
- closeFile(myFile)
- myFile = 0
- end
-